import {defHttp} from '/@/utils/http/axios';
import {PageParams} from "/@/api/model/baseModel";


enum Api {
    page = '/bus/category/page',
    list = '/bus/category/list',
    get = '/bus/category/get',
    add = '/bus/category/save',
    update = '/bus/category/update',
    remove = '/bus/category/remove'
}

export const page = (pageParams: PageParams) =>
    defHttp.get({url: Api.page, params: pageParams}, {errorMessageMode: 'none'});

export const list = () =>
    defHttp.get({url: Api.list}, {errorMessageMode: 'none'});

export const get = (id: string) =>
    defHttp.get({url: Api.get, params: {id: id}}, {errorMessageMode: 'none'});

export const add = (params) =>
    defHttp.post({url: Api.add, params: params}, {errorMessageMode: 'none'});

export const update = (params) =>
    defHttp.post({url: Api.update, params: params}, {errorMessageMode: 'none'});

export const remove = (ids: string) =>
    defHttp.post({url: Api.remove, params: {ids: ids}}, {errorMessageMode: 'none'});
